<%@ Page Language="c#" %>
<script runat="server">

    void AddAllBtn_Click(object src, EventArgs e){
    while (AvailableFonts.Items.Count != 0) {
    InstalledFonts.Items.Add(new ListItem(AvailableFonts.Items[0].Value));
    AvailableFonts.Items.Remove(AvailableFonts.Items[0].Value);
    }
    }
    
    void AddBtn_Click(object src, EventArgs e){
    if (AvailableFonts.SelectedIndex !=-1) {
    InstalledFonts.Items.Add(new ListItem(AvailableFonts.SelectedItem.Value));
    AvailableFonts.Items.Remove(AvailableFonts.SelectedItem.Value);
    
     }
    }
    
    void RemoveAllBtn_Click(object src,EventArgs e){
    while (InstalledFonts.Items.Count != 0) {
    AvailableFonts.Items.Add(new ListItem(InstalledFonts.Items[0].Value));
    InstalledFonts.Items.Remove(InstalledFonts.Items[0].Value);
    }
    }
    
    void RemoveBtn_Click(object src, EventArgs e){
    if (InstalledFonts.SelectedIndex != -1){
    AvailableFonts.Items.Add(new ListItem(InstalledFonts.SelectedItem.Value));
    InstalledFonts.Items.Remove(InstalledFonts.SelectedItem.Value);
    }
    }

</script>
<html>
<head>
    <link href="intro.css" rel="stylesheet" />
</head>
<body>
    <center>
        <form action="NewFile.aspx" method="post" runat="server">
            <h3>
                <asp:listbox id="AvailableFonts" runat="server" width="100px">
                    <asp:listitem>Roman</asp:listitem>
                    <asp:listitem>Arial Black</asp:listitem>
                    <asp:listitem>Garamond</asp:listitem>
                    <asp:listitem>Somona</asp:listitem>
                    <asp:listitem>Symbol</asp:listitem>
                </asp:listbox>
                <asp:listbox id="InstalledFonts" runat="server" width="100px">
                    <asp:listitem>Times</asp:listitem>
                    <asp:listitem>Helvetica</asp:listitem>
                    <asp:listitem>Arial</asp:listitem>
                </asp:listbox>
                <asp:button id="Button1" onclick="AddAllBtn_Click" runat="server" text=">>"></asp:button>
                <asp:button id="Button2" onclick="AddBtn_Click" runat="server" text=">"></asp:button>
                <asp:button id="Button3" onclick="RemoveAllBtn_Click" runat="server" text="<<"></asp:button>
                <asp:button id="Button4" onclick="RemoveBtn_Click" runat="server" text="<"></asp:button>
            </h3>
        </form>
    </center>
</body>
</html>
